Check if a condition is true relative to a given date

Check if a condition is true relative to a given date

To check if a boolean attribute is true relative to a given date you use the following Temporal Date functions: Temporal Before, Temporal After, Temporal On, Temporal On Or Before, Temporal On Or After.

What do you want to do?

Check if a condition is true before a given date and false on and afterwards

Check if a condition is true after a given date and false on and before

Check if a condition is true on a given date and false before and afterwards

Check if a condition is true on and before a given date and false afterwards

Check if a condition is true on or after a given date and false before

Check if a condition is true before a given date and false on and afterwards

The Temporal Before function returns a boolean attribute that varies over time and is true before a given date and false on and afterwards. The syntax for this function is:

 

For example, the Temporal Before function could be used to determine if the pre-2007 Ministerial Determination is in force (this was in force before 1/1/2007). In Word you would write this rule as:

the pre-2007 Ministerial Determination is in force if

TemporalBefore(2007-01-01)

 

As the diagram below illustrates, 'the pre-2007 Ministerial Determination is in force' (b2) is true before the given date (1/1/2007) and false on and after that date.

 

 

TIP: To see an example of a complete rulebase using this function in combination with the Temporal On Or After function, open and run the Aged Care Approval rulebase project provided in the Examples folder in the Oracle Policy Modeling installation folder.

Check if a condition is true after a given date and false on and before

The Temporal After function returns a boolean attribute that varies over time and is true after a given date and false on and before. The syntax for this function is:

 

For example, the Temporal After function could be used to determine if the July 2005 rate changes apply (these rates take effect after 30/6/2005). In Word you would write this rule as:

the July 2005 rate changes apply if

TemporalAfter(2005-06-30)

 

As the diagram below illustrates, 'the July 2005 rate changes apply' (b1) is false up to and on the given date (30/6/2005) and true after that date (ie from 1/7/2005 onwards).

 

Check if a condition is true on a given date and false before and afterwards

The Temporal On function returns a boolean attribute that varies over time and is true on a given date and false before and afterwards. The syntax for this function is:

 

For example, the Temporal On function could be used to determine if the New Millennium Promotion is available to customers (this promotion is only offered on 1/1/2000). In Word you would write this rule as:

the New Millennium Promotion is available to customers if

TemporalOn(2000-01-01)

 

As the diagram below illustrates, 'the New Millennium Promotion is available to customers' (b3) is only true on the given date (1/1/2000) and false before and after that date.

 

Check if a condition is true on and before a given date and false afterwards

The Temporal On Or Before function returns a boolean attribute that varies over time and is true on and before a given date and false afterwards. The syntax for this function is:

 

For example, the Temporal On Or Before function could be used to determine if the pre-Christmas price list applies (it applies up to 24/12/2007). In Word you would write this rule as:

the pre-Christmas price list applies if

TemporalOnOrBefore(2007-12-24)

 

As the diagram below illustrates, 'the pre-Christmas price list applies' (b5) is true up to and including the given date (24/12/2007) and false after that date (ie from 25/12/2007 onwards).

 

Check if a condition is true on or after a given date and false before

The Temporal On Or After function returns a boolean attribute that varies over time and is true on or after a given date and false before. The syntax for this function is:

 

For example, the Temporal On Or After function could be used to determine if the 2007 Ministerial Determination is in force (in force from 1/1/2007). In Word you would write this rule as:

the 2007 Ministerial Determination is in force if

TemporalOnOrAfter(2007-01-01)

 

As the diagram below illustrates, 'the 2007 Ministerial Determination is in force' (b4) is false before the given date (1/1/2007) and true on and after that date.

 

 

TIP: To see an example of a complete rulebase using this function in combination with the Temporal Before function, open and run the Aged Care Approval rulebase project provided in the Examples folder in the Oracle Policy Modeling installation folder.